(library (gl gl)
  (export
   gl-clear-color
   gl-clear
   gl-color3f
   gl-begin
   gl-vertex2f
   gl-vertex3f
   gl-end
   gl-flush)
  (import
   (chezscheme))

  (define lib (load-shared-object "opengl32.dll"))

  ;; GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
  (define gl-clear-color
    (foreign-procedure __stdcall "glClearColor" (float float float float) void))

  ;; GLAPI void GLAPIENTRY glClear( GLbitfield mask );
  (define gl-clear
    (foreign-procedure __stdcall "glClear" (unsigned) void))

  ;; GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue );
  (define gl-color3f
    (foreign-procedure __stdcall "glColor3f" (float float float) void))

  ;; GLAPI void GLAPIENTRY glBegin( GLenum mode );
  (define gl-begin
    (foreign-procedure __stdcall "glBegin" (unsigned) void))

  ;; GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y );
  (define gl-vertex2f
    (foreign-procedure __stdcall "glVertex2f" (float float) void))

  (define gl-vertex3f
    (foreign-procedure __stdcall "glVertex3f" (float float float) void))

  ;; GLAPI void GLAPIENTRY glEnd( void );
  (define gl-end
    (foreign-procedure __stdcall "glEnd" () void))

  ;; GLAPI void GLAPIENTRY glFlush( void );
  (define gl-flush
    (foreign-procedure __stdcall "glFlush" () void))
  )
